• home

Tutorials

  • C++ Language: Learn this versatile and powerful programming language. Includes detailed explanations of pointers, functions, classes and templates, among others...
  • Reference

    Description of the most important classes, functions and objects of the Standard Language Library, with descriptive fully-functional short programs as examples.
    Browse the C++ Reference

    Articles

    User-contributed articles, organized into different categories.
    You can contribute your own articles!
    Browse Articles

    Latest forum activity:

    Template errors creating a map<int,std::thread> using map::emplace   [Beginners]
     
    I created a class to try out std::lock_guard. The first function, UnsafeExample[/code] compiles and runs fine. The second example, [code]SafeExample[/code] d...
    [2 replies] Last: Thanks Peter. That was it. 1. std::ref(coutMutex) was necessary, for ... (by ElusiveTau)
    Short films worth watching   [Lounge]
     
    I don’t particularly like horror, but this one was great! The Curse of Dracular[/b] https://youtu.be/kjd6jETfd5c?si=Oa9pabr4-kvrHC6v (Contains a claymatio...
    [5 replies] Last: I'm not sure if it's a ' short[/i]' film, it's about 1.5hrs... [b]ALG... (by The Grey Wolf)
    How to initialize base class member with subclass member?   [Beginners]
     
    I'm working with code where CustomThreadApi[/code] is not modifiable. CustomThreadApi has a ctor that takes a [code]const char*[/code]. I would like to assign ...
    [2 replies] Last: baseClassBuff is unnecessary. I can just reuse MyThreadClass.Name[/co... (by ElusiveTau)
    Removing double quotes from Cstring   [Beginners]
     
    Hi, sorry its late... I am trying to do a few things with strings. - I need to remove double quotes from a users input - Then the string needs to be divide i...
    [8 replies] Last: You only get double quotes if some component of the filename path has ... (by Duthomhas)
    anagram using vector   [General C++ Programming]
     
    I am trying to solve this problem. Are there any other better approaches here? Implement a function which takes a list of words as an argument and finds all a...
    [2 replies] Last: If you go big (a large dictionary of words) you may want to move out t... (by jonnin)
    New Safe C++ Proposal (1,2,3,4,5,6)   [Lounge]
     
    There is now a Safe C++ proposal that extends C++ by defining a superset of the language that can be used to write code with strong safety guarantees. See: htt...
    [104 replies] Last: https://news.ycombinator.com/item?id=42231489 I've been reading quite... (by helios)
    Are these ternary operators the same?   [Beginners]
     
    Hello, What are the differences between these? #include <iostream> int main() { int a = 18, b = 44, total = 0, total2 = 0; total +=...
    [8 replies] Last: I think some chips have a way to test a single bit but in general, I d... (by jonnin)
    Making a shared_ptr out of a stack object corrupts the heap!!   [General C++ Programming]
     
    Hi, The following code is incorrect: Customer customer = { 0, "John Doe", "johndoe@example.com" }; auto cc = std::make_shared<Customer>(customer);...
    [2 replies] Last: Note: std::make_shared<T>()[/code] creates a new heap-allocated insta... (by kigar64551)
    C++23   [Lounge]
     
    C++23 has finally been accepted by ISO as the latest C++ standard ISO/IEC 14882:2024 For a useful summary of features see https://www.cppstories.com/2024/cp...
    [3 replies] Last: Note that something like for (auto& elem : getVector())[/code]has al... (by Peter87)
    Testing restart functionality in C/C++   [General C++ Programming]
     
    Hello! I am trying to implement "restart" functionality in my code, where if for some reason the code stops (i.e. iterations drop) I can pick up from where I s...
    [1 reply] : you will get more help if you put it in a repo where we can see the co... (by jonnin)